import React from "react";
import "../css/NavigationBars.css";

class NavigationBars extends React.Component {
  constructor(props) {
    super(props);
    console.log(this.props);
    this.state = {
      title: "",
    };
  }
  componentWillMount() {
    this.setState({
      title: this.props.title,
    });
  }
  render() {
    return (
      <div>
        <div className="navigation_bar_container">{this.state.title}<button onClick={()=>{
            this.props.sendMessage('我是子组件传递给父组件的数据')
        }}>点击</button></div>
        
      </div>
    );
  }
}
export default NavigationBars;
